package com.huaju.enity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * AdminNotice entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "admin_notice", catalog = "licai")
public class AdminNotice implements java.io.Serializable {

	// Fields

	private Integer noticeId;
	private Admin admin;
	private Date addTime;
	private String content;
	private String extr;

	// Constructors

	/** default constructor */
	public AdminNotice() {
	}

	/** full constructor */
	public AdminNotice(Admin admin, Date addTime, String content,
			String extr) {
		this.admin = admin;
		this.addTime = addTime;
		this.content = content;
		this.extr = extr;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "notice_id", unique = true, nullable = false)
	public Integer getNoticeId() {
		return this.noticeId;
	}

	public void setNoticeId(Integer noticeId) {
		this.noticeId = noticeId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "aid")
	public Admin getAdmin() {
		return this.admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	@Column(name = "addTime", length = 19)
    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss" ) 
    @JsonFormat(pattern="yyyy-MM-dd  hh:mm:ss" ,timezone = "GMT+8")
	public Date getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	@Column(name = "content", length = 256)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "extr", length = 256)
	public String getExtr() {
		return this.extr;
	}

	public void setExtr(String extr) {
		this.extr = extr;
	}

}